#set(title=bean.title)
#set(keywords=bean.title)
#set(description=bean.title)
#@layout()

#define main()
#@flyColumn()
<div class="layui-container">
	<div class="layui-row layui-col-space15">
    <div class="layui-col-md8 content detail">
        <!--内容-->
		<div class="fly-panel detail-box">
	        <h1>#(bean.title)</h1>
	        <div class="fly-detail-info">
                <!-- <span class="layui-badge">审核中</span> -->
				#if(bean.status == 30)
                <span class="layui-badge layui-bg-green fly-detail-column">私密</span>
				#else
				<span class="layui-badge layui-bg-green fly-detail-column">#(bean.typename)</span>
				#end

                <span class="layui-badge" style="background-color: #999;">未结</span>
                <!-- <span class="layui-badge" style="background-color: #5FB878;">已结</span> -->
				#if(bean.top == 10)
                <span class="layui-badge layui-bg-black">置顶</span>
				#end
				#if(bean.wonderful == 10)
                <span class="layui-badge layui-bg-red">精帖</span>
				#end
				#if(mine.roleid?? == 1)
                <div class="fly-admin-box" data-id="#(bean.contentid)">
                    <span class="layui-btn layui-btn-xs jie-admin" type="del">删除</span>
					#if(bean.top >= 20)
                    <span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" v="10" style="background-color:#ccc;">取消置顶</span>
					#else
                    <span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" v="20">置顶</span>
					#end

					#if(bean.wonderful >= 20)
                    <span class="layui-btn layui-btn-xs jie-admin" type="set" field="wonderful" v="10" style="background-color:#ccc;">取消加精</span>
					#else
                    <span class="layui-btn layui-btn-xs jie-admin" type="set" field="wonderful" v="20">加精</span>
					#end

					#if(bean.status != 30)
					<span class="layui-btn layui-btn-xs jie-admin" type="set" field="status" v="30">设为私密</span>
					#else
					<span class="layui-btn layui-btn-xs jie-admin" type="set" field="status" v="10">设为公开</span>
					#end
                </div>
				#end
                <span class="fly-list-nums">
                    <a href="#comment"><i class="iconfont" title="回答">&#xe60c;</i> #(bean.replynum??0)</a>
                    <i class="iconfont" title="人气">&#xe60b;</i> #(bean.viewnum??1)
                </span>
	        </div>
	        <div class="detail-about">
				<a class="fly-avatar" href="/user/#(bean.userid)">
					<img src="#(bean.avatar)" alt="#(bean.nickname)">
				</a>
				<div class="fly-detail-user">
					<a href="/user/#(bean.userid)" class="fly-link">
					<cite>#(bean.nickname)</cite>
					<!--
					<i class="iconfont icon-renzheng" title="认证信息：{{ rows.user.approve }}"></i>
					<i class="layui-badge fly-badge-vip">VIP3</i>
					-->
					</a>
					<span>#(bean.createtime??)</span>
				</div>
				<div class="detail-hits" id="LAY_jieAdmin" data-id="123">
					<!--
					<span style="padding-right: 10px; color: #FF7200">悬赏：60飞吻</span>
					-->
					#if(bean.userid == mine.userid?? || mine.roleid?? == 1)
					<span class="layui-btn layui-btn-xs jie-admin" type="edit"><a href="/jie/add/#(bean.contentid)">编辑此贴</a></span>
					#end
				</div>
	        </div>
	        <div class="detail-body photos">
				#(bean.content??)

                #if(bean.site?? || bean.git??)
                    <blockquote class="layui-elem-quote layui-quote-nm">
                    #if(bean.site??)
                    <b>个人博客地址：<a href="#(bean.site??)" target="_blank">#(bean.site??)</a></b>
                    #end
                    #if(bean.git??)
                    <b>码云/GitHub:<a href="#(bean.git??)" target="_blank">#(bean.git??)</a></b>
                    #end
                    </blockquote>
                #end
	        </div>
		</div>

        <!--评论-->
		<div class="fly-panel detail-box" id="flyReply">
	        <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
	          <legend>还有不明白？追问</legend>
	        </fieldset>

        	<ul class="jieda" id="jieda">
			#for(x : comments.rows??)
				<li data-id="#(x.commentid)" class="jieda-daan">
					<a name="item-1111111111"></a>
						<div class="detail-about detail-about-reply">
						<a class="fly-avatar" href="/user/#(x.userid)">
							<img src="#(x.avatar)" alt="#(x.nickname)">
						</a>
						<div class="fly-detail-user">
						<a href="" class="fly-link">
							<cite>#(x.nickname)</cite>
							<!--<i class="iconfont icon-renzheng" title="认证信息：XXX"></i>
							<i class="layui-badge fly-badge-vip">VIP3</i>-->
						</a>
						#if(x.userid == bean.userid??)
						<span>(楼主)</span>
						#end
		                <!--
		                <span style="color:#5FB878">(管理员)</span>
		                <span style="color:#FF9E3F">（社区之光）</span>
		                <span style="color:#999">（该号已被封）</span>
		                -->
              			</div>

						<div class="detail-hits"><span>#(x.createtime??)</span></div>
						#if(1>2)
						<i class="iconfont icon-caina" title="最佳答案"></i>
						#end
            			</div>
			            <div class="detail-body jieda-body photos">
							#(x.content)
			            </div>
						<div class="jieda-reply">
							#if(x.hadsupport == 1)
							<span class="jieda-zan zanok" type="zan"><i class="iconfont icon-zan"></i><em>#(x.supportnum)</em></span>
							#else
							<span class="jieda-zan" type="zan"><i class="iconfont icon-zan"></i><em>#(x.supportnum)</em></span>
							#end
							<span type="reply"><i class="iconfont icon-svgmoban53"></i>回复</span>
							<div class="jieda-admin">
								#if(x.userid == mine.userid?? && false)
								<span type="edit">编辑</span>
								<span type="del">删除</span>
								#end
								#if(bean.userid == mine.userid??)
								<span class="jieda-accept" type="accept">采纳</span>
								#end
							</div>
            			</div>
					</li>
					#else
					<li class="fly-none">消灭零回复</li>
					#end
        		</ul>

        		<div class="layui-form layui-form-pane">
					<form action="/jie/reply/" method="post">
						<div class="layui-form-item layui-form-text">
						<a name="comment"></a>
							<!--<div class="layui-input-block">
								<textarea id="mytextarea">Hello, World!</textarea>
							</div>-->
							<div id="editor"></div>
						</div>
						<div class="layui-form-item">
							<input type="hidden" name="contentid" value="#(bean.contentid??)">
							<input type="hidden" name="pid" value="0">
							<button class="layui-btn" lay-filter="jie-reply" lay-submit>提交回复</button>
						</div>
					</form>
        		</div>
      		</div>
    	</div>
    <div class="layui-col-md4">
		<!--热帖-->
		<dl class="fly-panel fly-list-one">
			<dt class="fly-panel-title">本周热帖</dt>
			#for(x : hotView.rows??)
			<dd>
				<a href="/jie/detail/#(x.contentid)">#(x.title)</a>
				<span><i class="iconfont icon-pinglun1"></i> #(x.viewnum)</span>
			</dd>
			#else
			<div class="fly-none">没有相关数据</div>
			#end
		</dl>

      	#define xx()
		<div class="fly-panel">
			<div class="fly-panel-title">
				这里可作为广告区域
			</div>
			<div class="fly-panel-main">
				<a href="http://layim.layui.com/?from=fly" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #5FB878;">LayIM 3.0 - layui 旗舰之作</a>
			</div>
		</div>

		<div class="fly-panel" style="padding: 20px 0; text-align: center;">
			<img src="../../res/images/weixin.jpg" style="max-width: 100%;" alt="layui">
			<p style="position: relative; color: #666;">微信扫码关注 layui 公众号</p>
		</div>
		#end

    </div>
	</div>
</div>
#end

#define js()
<!--wangEditor静态文件本地化-->
<script src="/res/wangEditor/wangEditor.min.js"></script>
<script>
    layui.cache.page = 'jie';
    layui.cache.user = {
        username: '游客'
        ,uid: -1
        ,avatar: '../../res/images/avatar/00.jpg'
        ,experience: 83
        ,sex: '男'
    };
    layui.config({
        version: false
        ,base: '../../res/mods/'
    }).extend({
        fly: 'index'
    }).use(['fly', 'jie'], function(){
        var $ = layui.jquery, fly = layui.fly;
        var jie = layui.jie;
        //如果你是采用模版自带的编辑器，你需要开启以下语句来解析。
        /*$('.detail-body').each(function(){
          var othis = $(this), html = othis.html();
          othis.html(fly.content(html));
        });*/

        jie.createEditer("comment");
    });
</script>
#end